﻿// -----------------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All rights reserved.
// -----------------------------------------------------------------------
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.Composition.Caching;
using System.IO;
using System.UnitTesting;
using System.Reflection;

namespace System.ComponentModel.Composition
{
    internal static class ComposablePartCatalogExtensions
    {
#if !SILVERLIGHT
        public static ComposablePartCatalog GetCachedCatalog(this ICachedComposablePartCatalog catalog)
        {
            string path = FileIO.GetTemporaryFileName("cache.dll");

            ComposablePartCatalogCachingServices.CacheCatalog(catalog, path);
            return ComposablePartCatalogCachingServices.ReadCatalogFromCache(path);
        }
#endif // !SILVERLIGHT
    }
}
